//
//  ChatInputView.h
//  TestChat
//
//  Created by yull on 14/12/7.
//  Copyright (c) 2014年 yull. All rights reserved.
//

#define ChatInputView_Height 46.0f

#import <UIKit/UIKit.h>
#import "RecordView.h"
#import "ChatFunctionView.h"

#import "MUPAudioRecorder.h"
#import "MUPAudioUtility.h"

typedef NS_ENUM(NSInteger, ChatInputViewStyle) {
    ChatInputViewStyleNormal,
    ChatInputViewStyleAudio,
    ChatInputViewStyleText,
    ChatInputViewStyleOther,
    ChatInputViewStyleExpression,
};

@protocol ChatInputViewDelegate <ChatFunctionViewDelegate>

- (void)recordAudioUrl:(NSString *)fileName audioData:(NSData *)audioData audioLength:(NSInteger)audioLength;

- (void)sendText:(NSString *)text;

- (void)beginRecord;

@end

@interface ChatInputView : UIView <UITextViewDelegate>

@property (nonatomic, strong) UIButton *buttonOther;

@property (nonatomic, strong) UIButton *buttonAudio;

@property (nonatomic, strong) UITextView *textViewInput;

@property (nonatomic, strong) UIButton *buttonInput;

@property (nonatomic, strong) ChatFunctionView *functionView;

@property (nonatomic, assign) ChatInputViewStyle style;

@property (nonatomic, assign) CGFloat topHeight;

@property (nonatomic, assign) CGFloat keyboardHeight;

@property (nonatomic, assign) BOOL animated;

@property (nonatomic, assign) id <ChatInputViewDelegate> delegate;

#pragma mark - 语音
@property (nonatomic, strong) MUPAudioRecorder *recordAudio;

@property (nonatomic, strong) RecordView *recordView;

@property (nonatomic, strong) NSTimer *detectTimer;

@property (nonatomic, assign) NSTimeInterval duration;

@end
